﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Foundation
{
    public struct Size
    {
        #region operator

        public static bool operator != (Size s1,Size s2)
        {
            return s1.Width != s2.Width || s1.Height != s2.Height;
        }

        public static bool operator ==(Size s1, Size s2)
        {
            return s1.Width == s2.Width && s1.Height == s2.Height;
        }

        public override int GetHashCode()
        {
            return this.Width.GetHashCode() ^ this.Height.GetHashCode();
        }

        public override string ToString()
        {
            return $"{this.Width},{this.Height}";
        }

        public override bool Equals(object obj)
        {
            if(obj is Size size) {
                return size.Width == this.Width && size.Height == this.Height;
            }
            return false;
        }

        #endregion

        /// <summary>
        /// 
        /// </summary>
        public float Width { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public float Height { get; set; }
    }
}
